package com.springboot.controller;

import com.springboot.aop.ControllerAop;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

@RestController
public class ExceptionController {
    @ControllerAop
    @PostMapping("/abc")
    public String exceptionMethod() {
        System.out.println("进入/abc");
        int i = 1 / 0;
        return "Hello World";
    }

    @PostMapping("/abd")
    public String exceptionMethod2() throws FileNotFoundException {
        FileInputStream inputStream = new FileInputStream("C:xxx/xxx.xxx");
        return "Hello Exception";
    }

}
